<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let p1 = 13555552314;
      let p2 = 13544447894;
      let p3 = 13555553698;

      // ***********************
      function change(text) {
        text = String(text);
        console.log(`${text.substring(0, 3)}****${text.substring(7)}`);
      }
      change(p1);
      // *****************************
      function change2(text) {
        text = String(text)
        console.log(`${text.slice(0, 3)}****${text.slice(7)}`);
      }
      change2(p2);
      // *****************************
      function change2(text) {
        text = String(text)
        console.log(`${text.substr(0, 3)}****${text.substr(7)}`);
      }
      change2(p3);
    </script>
  </body>
</html>
